// **********************************************************************
//
// Copyright (c) 2003-2005 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************

#include <PersonI.h>
#include <Ice/Ice.h>

using namespace std;

class Server:
  virtual public Ice::Application
{
  virtual int run(int argc,
		  char* argv[])
  {
    int status;
    try
      {
	status = EXIT_SUCCESS;
	Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapterWithEndpoints("pf", "tcp -p 10000");
	adapter->add(new PersonFactoryI(), communicator()->stringToIdentity("pf"));
	adapter->activate();
	
	communicator()->waitForShutdown();
    }
    catch(const Ice::Exception& ex)
      {
	cerr << ex << endl;
	status = EXIT_FAILURE;
      }
    return status;
  }
};

int main(int argc,
	 char* argv[])
{
  Server app;
  return app.main(argc, argv, "config.server");
}
